Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Demangle Anonymous Function Names #166

Merged
merged 1 commit into from
Nov 1, 2016

Conversation

marcomorain
Copy link
Contributor

Demangle compiler generated function names for anonymous functions and
replace with something more readable.

Change:

<BeginInvokeAsynchronousActionMethod>b__36

to:

BeginInvokeAsynchronousActionMethod { λ }

Fixes #147

@asbjornu
Copy link
Contributor

@marcomorain Thanks for this! But as you mention in #147, it would be awesome with more intelligence in the demangling of the anonymous method, which makes me think λ might look a bit esoteric and not very compatible with future improvements. I also asked a colleague and while he appreciated it, he thought it looked a bit too "smart". If we're able to figure out arguments, return value and such things, I think BeginInvokeAction { <lambda> } is a good place to start and then expand to () ⇒ … once we get (x, y) => z to work.

I'm also wondering about the BeginInvokeAction; is that a constant method name that will always exist on async methods? If so, we should probably replace that with the async keyword as well, no?

@marcomorain
Copy link
Contributor Author

I'll change this to use <lambda> rather than the greek symbol - I don't have a strong preference myself, and I think you are right - the greek symbol is us trying to be a bit too clever!

I'm also wondering about the BeginInvokeAction; is that a constant method name that will always exist on async methods? If so, we should probably replace that with the async keyword as well, no?

I don't have access to the ASP.net MVC source, but I'm very confident that BeginInvokeAction is the actual function name for invoking controller actions, rather than a compiler generated name.

Demangle compiler generated function names for anonymous functions and
replace with something more readable.

Change:

    <BeginInvokeAsynchronousActionMethod>b__36
to:

    BeginInvokeAsynchronousActionMethod { <lambda> }

Fixes getsentry#147
@marcomorain marcomorain force-pushed the feature-demangle-private branch from 660c9b5 to 87bff7b Compare November 1, 2016 11:26
@marcomorain
Copy link
Contributor Author

@asbjornu updated to use <lambda> name

@asbjornu asbjornu merged commit 2913aa1 into getsentry:develop Nov 1, 2016
@asbjornu
Copy link
Contributor

asbjornu commented Nov 1, 2016

@marcomorain: Thanks!

@marcomorain marcomorain deleted the feature-demangle-private branch November 1, 2016 15:33
@marcomorain
Copy link
Contributor Author

👍

@asbjornu
Copy link
Contributor

asbjornu commented Nov 2, 2016

Version 2.1.1-unstable0113 released with this folded in. If I don't hear anything negative about this release for the next couple of days, I'll try to push out a new stable by the end of the week.

@marcomorain
Copy link
Contributor Author

I've deployed this to production, I'll let you know if we have any problems. If you don't hear from me it's going well!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants